package com.epsoft.odin7cj.flow.util;

import org.camunda.bpm.engine.repository.Deployment;
import com.epsoft.odin7cj.core.enums.CoreDateStyle;
import com.epsoft.odin7cj.core.util.JhkjDateUtil;
import com.epsoft.odin7cj.flow.model.deploy.FlowDeployment;

/**
 * DESC: Bpmn中的Bean处理 <br>
 * @author 胡义振
 * @date 2020年5月21日
 */
public class BpmnBeanUtils {

	public static FlowDeployment convertToFlowDeployment(Deployment deployment) {
		FlowDeployment flowDeployment = new FlowDeployment();
		if(deployment!=null) {
			flowDeployment.setId(deployment.getId());
			flowDeployment.setName(deployment.getName());
			flowDeployment.setSource(deployment.getSource());
			flowDeployment.setDeploymentTime(JhkjDateUtil.dateToString(deployment.getDeploymentTime(), CoreDateStyle.YYYY_MM_DD.getValue()));
			flowDeployment.setTenantId(deployment.getTenantId());
		}
		return flowDeployment;
	}
	

}
